package com.lmc.forum.dao;

import com.lmc.forum.model.Article;
import lombok.Data;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ArticleMapper {
    int insert(Article row);

    int insertSelective(Article row);

    Article selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Article row);

    int updateByPrimaryKeyWithBLOBs(Article row);

    int updateByPrimaryKey(Article row);

    List<Article> selectAll();

    List<Article> selectByBoardId (Long boardId);

    Article selectDetailByArticleId (@Param("id") Long id);

    /**
     * 根据⽤⼾Id查询帖⼦列表以发布时间降序排列
     * @param userId ⽤⼾Id
     * @return ⽤⼾发布的帖⼦集合
     */
    List<Article> selectByUserId (Long userId);
}